#include <stdio.h>
#include <math.h>

int main(int argc, char const *argv[])
{
    int n, sum = 0, a[10001] = {0};
    scanf("%d", &n);

    for (int i = 2; i < n; i++)
        if (n % i == 0)
            for (int j = i; j <= n; j += i)
                a[j]++;

    for (int i = 1; i < n; i++)
        sum += (a[i] == 0) ? 1 : 0;

    printf("%d\n", (n == 1 ? 1 : sum));
    return 0;
}
